From 698959b530c437f6d86bc257e898ca7561978eca Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Fri, 20 Jul 2007 09:38:27 +0100 Subject: [PATCH] Fix hypercall migration. schedule_tail() is not required after set affinity, or else continue stub runs on current cpu immediately before migrating is checked when switching out. Signed-off-by Kevin Tian Signed-off-by: Keir Fraser --- xen/arch/x86/domain.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index f3241ff160..4f56b65f0a 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1394,6 +1394,9 @@ int continue_hypercall_on_cpu(int cpu, long (*func)(void *data), void *data) struct migrate_info *info; cpumask_t mask = cpumask_of_cpu(cpu); + if ( cpu == smp_processor_id() ) + return func(data); + info = xmalloc(struct migrate_info); if ( info == NULL ) return -ENOMEM; @@ -1407,8 +1410,9 @@ int continue_hypercall_on_cpu(int cpu, long (*func)(void *data), void *data) v->arch.continue_info = info; vcpu_set_affinity(v, &mask); - schedule_tail(v); + /* Dummy return value will be overwritten by new schedule_tail. */ + BUG_ON(!test_bit(SCHEDULE_SOFTIRQ, &softirq_pending(smp_processor_id()))); return 0; } -- 2.30.2